﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% 
'============================================================
' 更新: 2007-12-10
' 主页: http://wap.twapp.cn
' 电邮: xivn@163.com
' Q Q : QQ:531233814
' 版权: 燃点真情All Rights Reserved.
'============================================================ 
%>
<%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<!-- #include file="conn.asp" -->
<wml>
<head><meta http-equiv='Cache-Control' content='no-cache'/>
</head>
<%
IF  Request.QueryString("Action")="view" Then
	call view
else

	call index
end if

Function index%>
	<card id="index" title="最新公告"><p>
<img src="/IMG/GO.gif" alt="最新公告"/><br/>
	<%

	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "SELECT * FROM gonggo order by id desc"
	Rs.Open Sql,conn,1,1
	If Not rs.eof	Then
Dim PageSize,i
	PageSize=10							
	Dim Count,page,pagecount,gopage	
	gopage="gogao.asp?hk="&hk&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1    
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount	
	rs.move(pagesize*(page-1))
        response.write ("共:"&count&"条公告<br/>")				
	For i=1 To PageSize       						
	If rs.eof Then Exit For	%>			
<a href="gogao.asp?Action=view&amp;id=<%=rs("id")%>&amp;hk=<%=hk%>"><%=i+(page-1)*PageSize%>.<%=ubb(Rs("name"))%></a><br/> 
<%	rs.moveNext 								
	Next	
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a>"
Else
%>
	暂时没有公告！
<%end if
	
		Rs.close
		set rs=nothing

%><br/>--------<br/>
<a href="index.asp?hk=<%=hk%>">返回首页</a><br/>
</p>
</card>
</wml>
<%end Function%>
<%Function view%>
<card id="index" title="查看公告"><p>
<%

	id = Request.QueryString("id")
		Set rs=Server.CreateObject("Adodb.Recordset")
		Sql = "select  * from gonggo where id="&id&" order by id desc"
		rs.open sql,conn,1,1
	If Not rs.eof	Then
	%>
		标题:<%=UBB(rs("name"))%><br/>
		内容:<%=UBB(rs("title"))%><br/>
		添加时间:<%=rs("time")%><br/>
	<%	
Else
%>
	没有这个公告！
<%end if%><br/>--------<br/>
		<a href="gogao.asp?hk=<%=hk%>">公告列表</a><br/>
		<a href="index.asp?hk=<%=hk%>">返回首页</a><br/>
		</p>
		</card>
</wml>
<%
		Rs.close
		set rs=nothing
end Function%>